package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.LabelMapper;
import com.education.wisdom.pojo.Label;
import com.education.wisdom.service.ILabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 标签 服务层实现
 * 
 * @author ruoyi
 * @date 2018-11-13
 */
@Service
public class LabelServiceImpl implements ILabelService
{
	@Autowired
	private LabelMapper labelMapper;

	@Override
	public List<Label> selectLabelByCatalogId(Integer catalogId) {
		return labelMapper.selectLabelByCatalogId(catalogId);
	}

	/**
     * 查询标签信息
     * 
     * @param bqId 标签ID
     * @return 标签信息
     */
    @Override
	public Label selectLabelById(String bqId)
	{
	    return labelMapper.selectLabelById(bqId);
	}
	
	/**
     * 查询标签列表
     * 
     * @param label 标签信息
     * @return 标签集合
     */
	@Override
	public List<Label> selectLabelList(Label label)
	{
	    return labelMapper.selectLabelList(label);
	}
	
    /**
     * 新增标签
     * 
     * @param label 标签信息
     * @return 结果
     */
	@Override
	public int insertLabel(Label label)
	{
	    return labelMapper.insertLabel(label);
	}
	
	/**
     * 修改标签
     * 
     * @param label 标签信息
     * @return 结果
     */
	@Override
	public int updateLabel(Label label)
	{
	    return labelMapper.updateLabel(label);
	}

	/**
     * 删除标签对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteLabelByIds(String ids)
	{
		return labelMapper.deleteLabelByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Label> selectLabel(Map<String, Object> map) {
		return labelMapper.selectLabel(map);
	}

	@Override
	public List<Label> selectLables(String plAttribute) {
		return labelMapper.selectLables(Convert.toStrArray(plAttribute));
	}
	
}
